//自动加载所有Job
let jobs = (rc => {
    let result = [];
    rc.forEach(r => {
        r.keys().forEach((key) => {
            const name = key.substring(2, key.indexOf('.js'));
            const item = {
                install: function (framework) {
                    if (r(key).default != undefined) {
                        framework.jobs[name] = r(key).default;
                    }
                }
            }
            result.push(item);
        });
    });
    return result;
})([require.context('./', true, /\Job.js$/),
require.context('../business/schedules/', true, /\Job.js$/)]);

export default [
    ...jobs
];
